/*
Copyright (c) [2019年5月1日] [吴超]
[MBT_Studio] is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
		 http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
See the Mulan PSL v2 for more details.
*/
#pragma once

#include "节点/插座/C_物理物体插座.h"



typedef struct {
	E_值类型			type;
	std::vector<S_车轮插座属性>	车体属性s;
}S_Vector车轮属性;


/*typedef struct {
	E_插座类型			type;
	vector<S_车体属性>	车体属性s;
}S_Vector车辆属性;*/




class C_物理材质_1D插座 : public C_插座基类 {
	S_物理材质* m_默认数据;
public:
	C_物理材质_1D插座(std::wstring name);

	E_物理引擎					m_物理引擎;
	std::vector<S_物理材质*>	m_Value;

	void*		f_getData(uint8 链接ID);
	void		f_setData(void* data, uint8 线程ID = 0);

	std::wstring		f_getTypeName() { return L"[PHY_MAT]"; }
};
#define DEF_物理材质_1D插座(socket) dynamic_cast<C_物理材质_1D插座*>( (socket) )
#define DEF_物理材质_1D插座数据(socket) ( (vector<S_物理材质*>*)(socket->f_getData()) )

#define DEF_创建物理材质_1D插座_I(name)  socket = new C_物理材质_1D插座( (name) ); f_add插座(socket, E_插座方向::e_插座Type_输入);
#define DEF_创建物理材质_1D插座_O(name)  socket = new C_物理材质_1D插座( (name) ); f_add插座(socket, E_插座方向::e_插座Type_输出);






class C_物理几何插座_1D : public C_插座基类 {
public:
	C_物理几何插座_1D(std::wstring name);

	std::vector<S_物理几何体*>	m_Value;

	void*		f_getData(uint8 链接ID);
	void		f_setData(void* data, int64 ID = -1);

	std::wstring		f_getTypeName() { return L"[PHY_GON]"; }
};
#define DEF_物理几何Array1D插座(socket) dynamic_cast<C_物理几何插座_1D*>( (socket) )
#define DEF_物理几何插座_1D数据(socket, tid) ( (std::vector<S_物理几何体*>*)(socket->f_getData(tid)) )

#define DEF_创建物理几何体_1D插座_I(name)  socket = new C_物理几何插座_1D( (name) ); f_add插座(socket, E_插座方向::e_插座Type_输入);
#define DEF_创建物理几何体_1D插座_O(name)  socket = new C_物理几何插座_1D( (name) ); f_add插座(socket, E_插座方向::e_插座Type_输出);








class C_插座_物理体Array1D : public C_插座基类 {
public:
	C_插座_物理体Array1D(std::wstring name);
	~C_插座_物理体Array1D();
	
	//std::vector<S_物理体插座数据>	m_Value;
	std::vector<S_物理体*>			m_Value;

	void*		f_getData(uint8 链接ID);
	void		f_setData(void* data, uint8 线程ID = 0);

	PyObject*	f_bl_传入数据(PyObject* bl_data);
	PyObject*	f_输出_bl数据(PyObject* bl_data = 0);
	void		f_释放数据();
	std::wstring		f_getTypeName() { return L"[PHY_OB]"; }
private:
	
};
#define DEF_物理体Array1D插座(socket) dynamic_cast<C_插座_物理体Array1D*>( (socket) )
#define DEF_物理体插座_1D数据(socket, loc) ( (std::vector<S_物理体*>*)(socket->f_getData(loc)) )

#define DEF_创建物理体_1D插座_I(name)  socket = new C_插座_物理体Array1D( (name) ); f_add插座(socket, E_插座方向::e_插座Type_输入);
#define DEF_创建物理体_1D插座_O(name)  socket = new C_插座_物理体Array1D( (name) ); f_add插座(socket, E_插座方向::e_插座Type_输出);









class C_车轮属性插座Array1D : public C_插座基类 {
public:
	C_车轮属性插座Array1D(std::wstring name);
	~C_车轮属性插座Array1D();

	std::vector<S_车轮参数>	m_Value;

	void*		f_getData();
	void		f_setData(void* data, int64 ID = -1);
	PyObject*	f_输出_bl数据(PyObject* bl_data = 0);

};

#define DEF_转换为车轮属性Array1D插座(socket) dynamic_cast<C_车轮属性插座Array1D*>( (socket) )
#define DEF_车轮属性Array1D插座Value(socket, tid)  ((vector<S_车轮参数>*)( (socket)->f_getData(tid) ) )

#define DEF_创建车轮Array1D插座_I(name)  socket = new C_车轮属性插座Array1D( (name) ); f_add插座(socket, E_插座方向::e_插座Type_输入);
#define DEF_创建车轮Array1D插座_O(name)  socket = new C_车轮属性插座Array1D( (name) ); f_add插座(socket, E_插座方向::e_插座Type_输出);











class C_插座车辆属性_1D : public C_插座基类 {
public:
	C_插座车辆属性_1D(std::wstring name);
	~C_插座车辆属性_1D();

	std::vector<S_车体属性>	m_Value;

	void		f_update(C_插座基类* 连接到的输入节点, class C_节点基类* node);

	void*		f_getData();
	void		f_setData(void* data, int64 ID = -1);

};

#define DEF_车辆属性1D插座Value(socket)  ((vector<S_车体属性>*)socket->f_getData())





